package com.wukang.photovoltaicinspectionpictures.base

import android.app.Application
import android.content.Context
import android.util.Log
import com.wukang.photovoltaicinspectionpictures.BuildConfig
import com.wukang.photovoltaicinspectionpictures.logger.Rog

/**
 * 基础[Application]
 * @author wukang
 */
class BaseApplication : Application() {
    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        // 初始化日志工具
        Rog.init(this, BuildConfig.DEBUG)
        // 系统崩溃日志打印
        Thread.setDefaultUncaughtExceptionHandler { _: Thread?, throwable: Throwable? ->
            Rog.e("SysCrashLog", Log.getStackTraceString(throwable))
        }
    }
}